package com.neveu.android.ds.socketmessenger;

import java.net.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.Thread;

public class NetServer extends Thread {

	private ServerSocket serverSock;
	private Socket clientSock;
	private int serverPort = 7;

	public NetServer()
	{
		try {
			serverSock = new ServerSocket(7);
		}catch(IOException e){
			System.err.println("Could not establish listening socket on port " + serverPort);
		}
		
	}
	
	public void run()
	{
		String inStr = "";
		
		try {
			clientSock = serverSock.accept();
		
			BufferedReader in = 
			    new BufferedReader(
			    new InputStreamReader(
			    		clientSock.getInputStream()));

			while((inStr = in.readLine()) != null)
			{
				//relay string back to main activity
			}

		}catch (IOException e) {}
		

	}
}
